package faf.entities;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

/**
 * Represente un sondage
 */
@Entity
public class Survey {
	@Id()
	@GeneratedValue(strategy = GenerationType.AUTO)
	private long id;
	private String title;
	
	@Lob
	private String description;

	@Enumerated(EnumType.ORDINAL)
	private Confidentiality confidentiality;
	
	boolean open;
	
	@ManyToOne()
	private Account account;
	
	@OneToMany(cascade = CascadeType.ALL, mappedBy = "survey")
	private List<Question> questionList;
	
	@OneToMany(cascade= CascadeType.ALL, mappedBy = "survey")
	private List<Sheet> sheetList;

	public Confidentiality getConfidentiality() {
		return confidentiality;
	}

	public void setConfidentiality(Confidentiality confidentiality) {
		this.confidentiality = confidentiality;
	}

	public List<Question> getQuestionList() {
		return questionList;
	}

	public void setQuestionList(List<Question> questionList) {
		this.questionList = questionList;
	}

	public List<Sheet> getSheetList() {
		return sheetList;
	}

	public void setSheetList(List<Sheet> sheetList) {
		this.sheetList = sheetList;
	}

	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public boolean isOpen() {
		return open;
	}

	public void setOpen(boolean open) {
		this.open = open;
	}

}
